package WeeklyContest;

import java.util.Arrays;

/**
 * @author:gao
 * @date:2020/7/5
 * @time:9:47
 * @version:0.0.1
 * @description:196周周赛
 */


public class W196 {
}

class Solution1 {
    public boolean canMakeArithmeticProgression(int[] arr) {
        Arrays.sort(arr);
        int diff = arr[1]-arr[0];
        for (int i = 2; i <arr.length ; i++) {
            if(arr[i]-arr[i-1]!=diff) return false;
        }
        return true;
    }
}

class Solution2 {
    public int getLastMoment(int n, int[] left, int[] right) {
        int max =-1;
       for(int num:left){
           max =Math.max(max,num);
       }
       for(int num:right){
           max =Math.max(max,n-num);
       }
       return max;
    }
}

